home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / c++ / strstream.z / strstream
Encoding:
Text File  |  2002-10-03  |  6.9 KB  |  139 lines

  1. STRSTREAM(3C)                                        Last changed: 10-20-98
  2.  
  3.  
  4. NNAAMMEE
  5.      ssttrrssttrreeaamm - iioossttrreeaamm specialized to arrays
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssttrrssttrreeaamm..hh>>
  9.  
  10.      ccllaassss iiooss {{
  11.      ppuubblliicc::
  12.           eennuumm ooppeenn__mmooddee {{ iinn,, oouutt,, aattee,, aapppp,, ttrruunncc,, nnooccrreeaattee,, nnoorreeppllaaccee }}
  13.      ;;
  14.           //// aanndd lloottss ooff ootthheerr ssttuuffff,, sseeee iiooss((33CC)) ......
  15.      }} ;;
  16.  
  17.      ccllaassss iissttrrssttrreeaamm :: ppuubblliicc iissttrreeaamm {{
  18.      ppuubblliicc::
  19.                     iissttrrssttrreeaamm((cchhaarr**)) ;;
  20.                     iissttrrssttrreeaamm((cchhaarr**,, iinntt)) ;;
  21.           ssttrrssttrreeaammbbuuff**  rrddbbuuff(()) ;;
  22.      }} ;;
  23.  
  24.      ccllaassss oossttrrssttrreeaamm :: ppuubblliicc oossttrreeaamm {{
  25.      ppuubblliicc::
  26.                     oossttrrssttrreeaamm(());;
  27.                     oossttrrssttrreeaamm((cchhaarr**,, iinntt,, iinntt==iiooss::::oouutt)) ;;
  28.           iinntt       ppccoouunntt(()) ;;
  29.           ssttrrssttrreeaammbbuuff**  rrddbbuuff(()) ;;
  30.           cchhaarr**          ssttrr(());;
  31.      }};;
  32.  
  33.      ccllaassss ssttrrssttrreeaamm :: ppuubblliicc ssttrrssttrreeaammbbaassee,, ppuubblliicc iioossttrreeaamm {{
  34.      ppuubblliicc::
  35.                     ssttrrssttrreeaamm(());;
  36.                     ssttrrssttrreeaamm((cchhaarr**,, iinntt,, iinntt mmooddee));;
  37.           ssttrrssttrreeaammbbuuff**  rrddbbuuff(()) ;;
  38.           cchhaarr**          ssttrr(());;
  39.      }};;
  40.  
  41. IIMMPPLLEEMMEENNTTAATTIIOONN
  42.      IRIX systems
  43.  
  44. DDEESSCCRRIIPPTTIIOONN
  45.      ssttrrssttrreeaamm specializes iioossttrreeaamm for incore operations, that is, storing
  46.      and fetching from arrays of bytes.  The ssttrreeaammbbuuff associated with a
  47.      ssttrrssttrreeaamm is a ssttrrssttrreeaammbbuuff [see ssssbbuuff(3C)].
  48.  
  49.      The following assumptions are made regarding the descriptions on this
  50.      man page:
  51.  
  52.      * _s_s is a ssttrrssttrreeaamm.
  53.  
  54.      * _i_s_s is an iissttrrssttrreeaamm.
  55.  
  56.      * _o_s_s is an oossttrrssttrreeaamm.
  57.  
  58.      * _c_p is a cchhaarr**.
  59.  
  60.      * _m_o_d_e is an iinntt representing an ooppeenn__mmooddee.
  61.  
  62.      * _i and _l_e_n are iinntts.
  63.  
  64.      * _s_s_b is a ssttrrssttrreeaammbbuuff**.
  65.  
  66.    CCoonnssttrruuccttoorrss
  67.      iissttrrssttrreeaamm((_c_p))
  68.           Characters will be fetched from the (null-terminated) string _c_p.
  69.           The terminating null character will not be part of the sequence.
  70.           Seeks (iissttrreeaamm::::sseeeekkgg(())) are allowed within that space.
  71.  
  72.      iissttrrssttrreeaamm((_c_p,, _l_e_n))
  73.           Characters will be fetched from the array beginning at _c_p and
  74.           extending for _l_e_n bytes.  Seeks (iissttrreeaamm::::sseeeekkgg(())) are allowed
  75.           anywhere within that array.
  76.  
  77.      oossttrrssttrreeaamm(())
  78.           Space will be dynamically allocated to hold stored characters.
  79.  
  80.      oossttrrssttrreeaamm((_c_p,,_n,,_m_o_d_e))
  81.           Characters will be stored into the array starting at _c_p and
  82.           continuing for _n bytes.  If iiooss::::aattee or iiooss::::aapppp is set in _m_o_d_e,
  83.           _c_p is assumed to be a null-terminated string and storing will
  84.           begin at the null character.  Otherwise storing will begin at _c_p.
  85.           Seeks are allowed anywhere in the array.
  86.  
  87.      ssttrrssttrreeaamm(())
  88.           Space will be dynamically allocated to hold stored characters.
  89.  
  90.      ssttrrssttrreeaamm((_c_p,,_n,,_m_o_d_e))
  91.           Characters will be stored into the array starting at _c_p and
  92.           continuing for _n bytes.  If iiooss::::aattee or iiooss::::aapppp is set in _m_o_d_e,
  93.           _c_p is assumed to be a null-terminated string and storing will
  94.           begin at the null character.  Otherwise storing will begin at _c_p.
  95.           Seeks are allowed anywhere in the array.
  96.  
  97.    iissttrrssttrreeaamm MMeemmbbeerrss
  98.      _s_s_b == _i_s_s..rrddbbuuff(())
  99.           Returns the ssttrrssttrreeaammbbuuff associated with _i_s_s.
  100.  
  101.    oossttrrssttrreeaamm MMeemmbbeerrss
  102.      _s_s_b == _o_s_s..rrddbbuuff(())
  103.           Returns the ssttrrssttrreeaammbbuuff associated with _o_s_s.
  104.  
  105.      _c_p==_o_s_s..ssttrr(())
  106.           Returns a pointer to the array being used and ``freezes'' the
  107.           array.  Once ssttrr has been called the effect of storing more
  108.           characters into _o_s_s is undefined.  If _o_s_s was constructed with an
  109.           explicit array, _c_p is just a pointer to the array.  Otherwise, _c_p
  110.           points to a dynamically allocated area.  Until ssttrr is called,
  111.           deleting the dynamically allocated area is the responsibility of
  112.           _o_s_s.  After ssttrr returns, the array becomes the responsibility of
  113.           the user program.
  114.  
  115.      _i==_o_s_s..ppccoouunntt(())
  116.           Returns the number of bytes that have been stored into the
  117.           buffer.  This is mainly of use when binary data has been stored
  118.           and _o_s_s..ssttrr(()) _d_o_e_s _n_o_t _p_o_i_n_t _t_o _a _n_u_l_l _t_e_r_m_i_n_a_t_e_d _s_t_r_i_n_g.
  119.  
  120.    ssttrrssttrreeaamm MMeemmbbeerrss
  121.      _s_s_b == _s_s..rrddbbuuff(())
  122.           Returns the ssttrrssttrreeaammbbuuff associated with _s_s.
  123.  
  124.      _c_p==_s_s..ssttrr(())
  125.           Returns a pointer to the array being used and ``freezes'' the
  126.           array.  Once ssttrr has been called the effect of storing more
  127.           characters into _s_s is undefined.  If _s_s was constructed with an
  128.           explicit array, _c_p is just a pointer to the array.  Otherwise, _c_p
  129.           points to a dynamically allocated area.  Until ssttrr is called,
  130.           deleting the dynamically allocated area is the responsibility of
  131.           _s_s.  After _s_t_r returns, the array becomes the responsibility of
  132.           the user program.
  133.  
  134. SSEEEE AALLSSOO
  135.      ssttrrssttrreeaammbbuuff(3C), iiooss(3C), iissttrreeaamm(3C), oossttrreeaamm(3C)
  136.  
  137.      This man page is available only online.
  138.  
  139.